package org.insia.smartposse.mapping.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the projects table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="projects"
 */

public abstract class BaseProjects  implements Serializable {

	public static String REF = "Projects";
	public static String PROP_END_DATE = "EndDate";
	public static String PROP_SHORT_DESCRIPTION = "ShortDescription";
	public static String PROP_SUBJECT = "Subject";
	public static String PROP_CREATED_DATE = "CreatedDate";
	public static String PROP_CATEGORY_ID = "CategoryId";
	public static String PROP_BUDGET = "Budget";
	public static String PROP_START_DATE = "StartDate";
	public static String PROP_MANAGER_ID = "ManagerId";
	public static String PROP_COMPANY = "Company";
	public static String PROP_ID = "Id";
	public static String PROP_LOCATION = "Location";
	public static String PROP_COMPLETE = "Complete";


	// constructors
	public BaseProjects () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseProjects (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseProjects (
		java.lang.Integer id,
		java.util.Date createdDate,
		java.util.Date startDate,
		java.util.Date endDate,
		boolean complete) {

		this.setId(id);
		this.setCreatedDate(createdDate);
		this.setStartDate(startDate);
		this.setEndDate(endDate);
		this.setComplete(complete);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.util.Date createdDate;
	private java.util.Date startDate;
	private java.util.Date endDate;
	private boolean complete;
	private java.lang.String location;
	private java.lang.String company;
	private java.lang.String subject;
	private java.lang.String shortDescription;
	private double budget;

	// many to one
	private org.insia.smartposse.mapping.Users managerId;
	private org.insia.smartposse.mapping.Categories categoryId;

	// collections
	private java.util.Set<org.insia.smartposse.mapping.JobProject> jobProjectList;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="increment"
     *  column="projects_id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: created_date
	 */
	public java.util.Date getCreatedDate () {
		return createdDate;
	}

	/**
	 * Set the value related to the column: created_date
	 * @param createdDate the created_date value
	 */
	public void setCreatedDate (java.util.Date createdDate) {
		this.createdDate = createdDate;
	}



	/**
	 * Return the value associated with the column: start_date
	 */
	public java.util.Date getStartDate () {
		return startDate;
	}

	/**
	 * Set the value related to the column: start_date
	 * @param startDate the start_date value
	 */
	public void setStartDate (java.util.Date startDate) {
		this.startDate = startDate;
	}



	/**
	 * Return the value associated with the column: end_date
	 */
	public java.util.Date getEndDate () {
		return endDate;
	}

	/**
	 * Set the value related to the column: end_date
	 * @param endDate the end_date value
	 */
	public void setEndDate (java.util.Date endDate) {
		this.endDate = endDate;
	}



	/**
	 * Return the value associated with the column: complete
	 */
	public boolean isComplete () {
		return complete;
	}

	/**
	 * Set the value related to the column: complete
	 * @param complete the complete value
	 */
	public void setComplete (boolean complete) {
		this.complete = complete;
	}



	/**
	 * Return the value associated with the column: location
	 */
	public java.lang.String getLocation () {
		return location;
	}

	/**
	 * Set the value related to the column: location
	 * @param location the location value
	 */
	public void setLocation (java.lang.String location) {
		this.location = location;
	}



	/**
	 * Return the value associated with the column: company
	 */
	public java.lang.String getCompany () {
		return company;
	}

	/**
	 * Set the value related to the column: company
	 * @param company the company value
	 */
	public void setCompany (java.lang.String company) {
		this.company = company;
	}



	/**
	 * Return the value associated with the column: subject
	 */
	public java.lang.String getSubject () {
		return subject;
	}

	/**
	 * Set the value related to the column: subject
	 * @param subject the subject value
	 */
	public void setSubject (java.lang.String subject) {
		this.subject = subject;
	}



	/**
	 * Return the value associated with the column: short_description
	 */
	public java.lang.String getShortDescription () {
		return shortDescription;
	}

	/**
	 * Set the value related to the column: short_description
	 * @param shortDescription the short_description value
	 */
	public void setShortDescription (java.lang.String shortDescription) {
		this.shortDescription = shortDescription;
	}



	/**
	 * Return the value associated with the column: budget
	 */
	public double getBudget () {
		return budget;
	}

	/**
	 * Set the value related to the column: budget
	 * @param budget the budget value
	 */
	public void setBudget (double budget) {
		this.budget = budget;
	}



	/**
	 * Return the value associated with the column: manager_id
	 */
	public org.insia.smartposse.mapping.Users getManagerId () {
		return managerId;
	}

	/**
	 * Set the value related to the column: manager_id
	 * @param managerId the manager_id value
	 */
	public void setManagerId (org.insia.smartposse.mapping.Users managerId) {
		this.managerId = managerId;
	}



	/**
	 * Return the value associated with the column: category_id
	 */
	public org.insia.smartposse.mapping.Categories getCategoryId () {
		return categoryId;
	}

	/**
	 * Set the value related to the column: category_id
	 * @param categoryId the category_id value
	 */
	public void setCategoryId (org.insia.smartposse.mapping.Categories categoryId) {
		this.categoryId = categoryId;
	}



	/**
	 * Return the value associated with the column: JobProjectList
	 */
	public java.util.Set<org.insia.smartposse.mapping.JobProject> getJobProjectList () {
		return jobProjectList;
	}

	/**
	 * Set the value related to the column: JobProjectList
	 * @param jobProjectList the JobProjectList value
	 */
	public void setJobProjectList (java.util.Set<org.insia.smartposse.mapping.JobProject> jobProjectList) {
		this.jobProjectList = jobProjectList;
	}

	public void addToJobProjectList (org.insia.smartposse.mapping.JobProject jobProject) {
		if (null == getJobProjectList()) setJobProjectList(new java.util.TreeSet<org.insia.smartposse.mapping.JobProject>());
		getJobProjectList().add(jobProject);
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof org.insia.smartposse.mapping.Projects)) return false;
		else {
			org.insia.smartposse.mapping.Projects projects = (org.insia.smartposse.mapping.Projects) obj;
			if (null == this.getId() || null == projects.getId()) return false;
			else return (this.getId().equals(projects.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}